#ifndef LEVELDB_MGR_H__
#define LEVELDB_MGR_H__

#include <iostream>
#include <map>
#include <vector>
#include <set>
#include "boost/shared_ptr.hpp"

#include "leveldb/options.h"


namespace leveldb
{
	class DB;
	//struct Options;
	class Iterator;
}

typedef boost::shared_ptr<leveldb::Iterator> DBIterator;

class LevelDBMgr
{
public:
    LevelDBMgr();
	virtual ~LevelDBMgr();
	int Get(const std::string &strKey, std::string &strValue);
    int Get(std::map<std::string, std::string> &Key2ValueMap);
    int Write(std::map<std::string, std::string> &Key2ValueMap);
    int Delete(const std::string &strKey);
	int Delete(const std::vector<std::string> &oVecKeys);
    bool Open(const std::string &strDBFullName);
	void Close();

private:
	leveldb::DB* db;
	leveldb::Options m_options;
};

#endif
